clc;
clf;
clear all;
tx =load('/home/rohit/Desktop/pan2a/tx250a');
rx =load('/home/rohit/Desktop/pan2a/rx250a');
ddur = 670;
cdur= 357;
pdelay= 4;

len=size(tx,1);
j=1;
k=1;
for i=1:len
    if(tx(i,1)==0)
       tx_tx(j,:)=tx(i,:);
       j=j+1;
    else 
        tx_rx(k,:)=tx(i,:);
        k=k+1;
    end
end

%rx=rx2a;

len=size(rx,1);
j=1;
k=1;
for i=1:len
    if(rx(i,1)==0)
       rx_tx(j,:)=rx(i,:);
       j=j+1;
    else 
        rx_rx(k,:)=rx(i,:);
        k=k+1;
    end
end
plot(tx_tx(:,4),39,'b*', rx_tx(:,4)+pdelay,42,'b*',tx_rx(:,4),39,'r*',rx_rx(:,4)+pdelay,42,'r*');

hold on;
for i=1:size(tx_tx,1)
plot([tx_tx(i,4),tx_tx(i,4)+pdelay],[39,42]);
end
for i=1:size(tx_tx,1)
	if(i==3)
	plot([tx_tx(i,4)+cdur,tx_tx(i,4)+cdur+pdelay],[39,42]);
	else
plot([tx_tx(i,4)+ddur,tx_tx(i,4)+ddur+pdelay],[39,42]);
endif
end


for i=1:size(rx_tx,1)
plot([rx_tx(i,4)+pdelay,rx_tx(i,4)+pdelay+pdelay],[42,39],'r');
end
for i=1:size(rx_tx,1)
plot([rx_tx(i,4)+cdur+pdelay,rx_tx(i,4)+cdur+pdelay+pdelay],[42,39],'r');
end


ylim([35 45]);
hold on;
line([0 ;250000 ],[39; 39])
hold on;
line([0 ;250000 ],[42; 42])
%axis([5.5e4,10.5e4,1,50]);


